package symbols;

import lexer.Word;
import lexer.Tag;

public class Type extends Word{
	
	public int width = 0;
	
	public Type(String s, int tag, int espaco){
		super(s, tag);
		width = espaco;
	}
	
	public static final Type
		INT = new Type ("int", Tag.BASIC, 4),
		BOOL = new Type ("int", Tag.BASIC, 1),
		VOID = new Type ("void", Tag.BASIC, 0);
	
	public static boolean numerico(Type p){
		if(p == Type.INT)return true;
		else return false;
	}
	
	public static Type compara(Type t1, Type t2){
		if(t1.equals(INT) && t2.equals(INT)) return INT;
		else if(t1.equals(BOOL) && t2.equals(BOOL)) return BOOL;
		else return null;
	}

}
